package main.Q1601_1700;

public class Q1681_1690 {
	public static void main(String[] args) {
		System.out.println("Question1681：");
		System.out.println("Question1682：");
		System.out.println("Question1683：");
		System.out.println("Question1684：统计一致字符串的数目");
		System.out.println("Question1685：");
		System.out.println("Question1686：");
		System.out.println("Question1687：");
		System.out.println("Question1688：");
		System.out.println("Question1689：十-二进制数的最少数目");
		System.out.println("Question1690：");
	}
}

class Question1684 {
	public boolean process(int[] allowedArr, String str) {
		int[] strArr = new int[26];
		for (char c : str.toCharArray()) strArr[c - 'a']++;//字符串中字符情况
		for (int i = 0; i < 26; i++) {
			if (allowedArr[i] == 0 && strArr[i] != 0) return false;
		}
		return true;
	}

	public int countConsistentStrings(String allowed, String[] words) {
		int count = 0;
		int[] allowedArr = new int[26];
		for (char c : allowed.toCharArray()) allowedArr[c - 'a'] = 1;//allowed字符串中字符种类
		for (String str : words) {
			if (process(allowedArr, str)) count++;
		}
		return count;
	}
}

class Question1689 {
	public int minPartitions(String n) {
		char max='0';
		for (int i=0;i<n.length();i++) {
			if (max<n.charAt(i)) {
				max=n.charAt(i);
			}
		}
		return max-'0';
	}
}